#pragma once
#include <string>
#include <cstddef> 
#include <odb/nullable.hxx>
#include <odb/core.hxx>
#include <boost/date_time/posix_time/posix_time.hpp>

namespace wzl 
{
    #pragma db object table("relation")
    class Relation
    {
    public:
        Relation()
        {}
        Relation(const std::string& uid,const std::string& pid)
            :_user_id(uid)
            ,_peer_id(pid)
        {}
        std::string user_id() {return _user_id;}
        void user_id(std::string& val) {_user_id = val;}

        std::string peer_id() {return _peer_id;}
        void peer_id(std::string& val) {_peer_id = val;}
    private:
        friend class odb::access;
        #pragma db id auto
        unsigned long _id;
        #pragma db type("varchar(64)") index 
        std::string _user_id;
        #pragma db type("varchar(64)") 
        std::string _peer_id;

    };
}